package com.honglv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.honglv.pojo.dto.UpdateRounteDTO;
import com.honglv.pojo.entity.Rounte;
import com.honglv.pojo.vo.GetRounteVO;
import com.honglv.pojo.vo.RounteShowVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RounteMapper extends BaseMapper<Rounte> {

    /**
     * Description:获取点赞数前四条的路线信息
     * date: 2024/03/28
     * author:王铭杰
     */
    List<RounteShowVO> getTopRounte();

    List<RounteShowVO> getAllRountes();

    GetRounteVO getRounte(@Param("id") Long id);

    Long like(@Param("id") Long id, @Param("num") Integer num);

    Long getLikeCount(@Param("id") Long id);

    List<RounteShowVO> getRountesByAuthorId(@Param("userId") Long userId);

    @Delete("DELETE FROM tb_rounte WHERE id = #{id}")
    void deleteRounte(Long id);

    Integer updateRounte(UpdateRounteDTO updateRounteDTO);
}
